home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / comm1 / calllggr.lha / call_log1 / Call_Logger next >
Text File  |  1996-05-08  |  13KB  |  299 lines

  1. /**************************************************************************\
  2.              $VER: Call Logger, v3.32 by Dotoran (8-May-96)
  3. \**************************************************************************/
  4.  options results;signal on SYNTAX;signal on ERROR;signal on IOERR
  5. tr=transmit ; se=sendstring ; gc=getchar ; gu=getuser
  6. WAIT:;if getclip('logger')=1 then signal WAIT;call setclip('logger','1')
  7. /*************************************************************************\
  8.      SysOp Definable Variables: See the _READ_ME! file for more info!
  9. \*************************************************************************/
  10. V1  = "X"    /* Ignore these Port Numbers.  If X, log all Ports.         */
  11. V2  = "X"    /* Ignore these ID Numbers.    If X, log all ID Numbers.    */
  12. V3  = "X"    /* Ignore these Access Levels. If X, log all Accesses.      */
  13. V4  = 10     /* Max calls to log ever.  Will never exceed this value.    */
  14. V5  = 0      /* Save Call-Backs to the Log? ( 1 = Yes / 0 = No )         */
  15. V6  = 5      /* Log SysOp(ID1) only when (s)he makes this many calls.    */
  16. V7  = 2      /* Activity Flag Backdrop: 1:dots,  2:dashes, 3:lowercase,  */
  17.              /*                         4:stars, 5:sm. x's 6:equals'     */
  18. V8  = "#"    /* 7: Use Ascii character in V8 as filler when V7=7.        */
  19. V9  = 1      /* Allow Log to be Aborted.    ( 1 = Yes / 0 = No )         */
  20. V10 = 0      /* Call_Log Output Type.  ( 0 = Elaborate / 1 = Quick )     */
  21. V11 = 0      /* Call_Log Ordering. ( 0 = Newest 1st / 1 = Oldest 1st )   */
  22. V12 = "db"   /* Quick Log Entry Colors (The MCI code that follows c)    */
  23. V13 = 0      /* Notate Call_Log Ignores?    ( 0 = No / 1 = Yes )         */
  24. V14 = "c"    /* Quick Log Border Color. (The MCI code that follows c)   */
  25. V15 = 1      /* Clear Screen Before Displaying Log? (0=No, 1=Yes)        */
  26. D1  = "TEXTS:"                    /* Where the Call_Log is stored.       */
  27. /*************************************************************************\
  28.       The values of D1 and D2 should both end with either a : or a /
  29. \*************************************************************************/
  30.  gu 23;port=result;gu 1;handle=result;gu 40;id=result;gu 15;access=result
  31. gu 24;baud=left(result,2);gu 1311992;D2=result;total=V4;flag=0;bc="c"V14
  32. if index(v1,port)>0|index(v2,id)>0|index(v3,access)>0 then flag=1
  33. if flag=1&V13=0 then signal QUIT ; cs='' ; if V15=1 then cs='f1'
  34. if V10=0 then call DATA0 ; if V10=1 then call DATA1
  35. call READCONFIG ; call COMPUTERS ; call READLOG
  36. if index(lc.2,handle)>0&V5=0 then flag=1
  37. if id=1&sysopcalls<V6 then flag=1
  38.   else do ; sysopcalls=0 ; call SAVECONFIG ; end
  39. if flag=1&V13=0 then signal QUIT
  40. gu 1100465 ; com=comp.result ; gu 1400472 ; calls=result
  41. gu 1400476 ; posts=result    ; gu 1400488 ; uploads=result
  42.  
  43. se 'Call logging...'
  44. do i=1 to 9 ; a.i=0 ; end i
  45. file='sysdata:Log/port'port
  46.  
  47. call open(f1,file,'r')
  48.   do j=1 until eof(f1)
  49.     c.j=readln(f1)
  50.   end j
  51. call close(f1)
  52.  
  53. do i=1 to j
  54.   if index(c.i,'SIGNON')>0   then key1=i
  55.   if index(c.i,'SIGNOFF')>0  then key2=i
  56.   if index(c.i,'NEW USER')>0 then a.9=1
  57. end i
  58.  
  59. if a.9=1 then new='*' ; else new=' '
  60. s1=substr(c.key1,11,5) ; s2=left(s1,2)
  61. hr='a' ; if s2>'11' then hr='p' ; if s2>'12' then s2=s2-12
  62. if s2='00' then s2='12' ; s1=s2||substr(s1,3)hr
  63. signon=right(s1,6) ; s1=substr(c.key2,11,5) ; s2=left(s1,2)
  64. hr='a' ; if s2>'11' then hr='p' ; if s2>'12' then s2=s2-12
  65. if s2='00' then s2='12' ; s1=s2||substr(s1,3)hr
  66. signoff=right(s1,6) ; key3=key2+1
  67.  
  68. do i=key3 to j
  69.   if index(c.i,'po')>0 then a.1=1
  70.   if index(c.i,'re')>0 then a.2=1
  71.   if index(c.i,'uf')>0 then a.3=1
  72.   if index(c.i,'df')>0 then a.4=1
  73.   if index(c.i,'do')>0 then a.5=1
  74.   if index(c.i,'tx')>0 then a.6=1
  75.   if index(c.i,'fb')>0 then a.7=1
  76.   if index(c.i,'ms')>0 then a.8=1
  77. end i
  78.  
  79. if V10=0 then do
  80.   s1='ceP c9R cfU caD ceG c9T cfF caMcd]' ; s2=''
  81.   if V7=1 then s2='c5. c5. c5. c5. c5. c5. c5. c5.cd]'
  82.   if V7=2 then s2='c5- c5- c5- c5- c5- c5- c5- c5-cd]'
  83.   if V7=3 then s2='c5p c5r c5u c5d c5g c5t c5f c5mcd]'
  84.   if V7=4 then s2='c5* c5* c5* c5* c5* c5* c5* c5*cd]'
  85.   if V7=5 then s2='c5x c5x c5x c5x c5x c5x c5x c5xcd]'
  86.   if V7=6 then s2='c5= c5= c5= c5= c5= c5= c5= c5=cd]'
  87.   if V7=7 then do
  88.     do i=1 to 8
  89.       s2=s2'c5'V8' '
  90.     end i ; s2=strip(s2)'cd]'
  91.   end
  92.   a1='cd['
  93.   do i=1 to 8 ; act=act+a.i
  94.     if a.i=0 then a1=a1||word(s2,i,1)
  95.       else a1=a1||word(s1,i,1)
  96.   end i
  97.   if act=0 then a1='cd[ceNothing!cd]'
  98.   log='z4 z0cfºcb'right(port,2)'cc 'center(id,3)' cf'new
  99.   log=log'ca'left(handle,20)'c9'left(baud,3)a1' c7'signon
  100.   log=log' ce'signoff'ca'right(access,4)' c9'com
  101.   log=log'cd'right(calls,4)'cb'right(uploads,4)'ce'
  102.   log=log||right(posts,4)'cfºz4 z0'
  103.   if V13=1&flag=1 then do
  104.     log='z4 z0cfºcb'right(port,2)'cd ----caOccupiedcd---caFor'
  105.     log=log'cd---caPrivatecd---caUsecd----c7 'signon' ce'
  106.     log=log||signoff' cd-caPortcd-caUnAvailablecd- cfºz4 z0'
  107.   end
  108. end
  109.  
  110. if V10=1 then do
  111.   s1='P R U D G T F M]';s2='' ; a1='['
  112.   if V7=1 then s2='. . . . . . . .}'
  113.   if V7=2 then s2='- - - - - - - -]'
  114.   if V7=3 then s2='p r u d g t f m]'
  115.   if V7=4 then s2='* * * * * * * *}'
  116.   if V7=5 then s2='x x x x x x x x}'
  117.   if V7=6 then s2='= = = = = = = =}'
  118.   if V7=7 then do
  119.     do i=1 to 8
  120.       s2=s2||V8' '
  121.     end i
  122.     s2=strip(s2)']'
  123.   end
  124.   do i=1 to 8 ; act=act+a.i
  125.     if a.i=0 then a1=a1||word(s2,i,1)
  126.       else a1=a1||word(s1,i,1)
  127.   end i
  128.   if act=0 then a1='[Nothing!]'
  129.   log=' 'bc'ºc'co||right(port,2)' 'center(id,3)' 'new
  130.   log=log||left(handle,20)left(baud,3)a1' 'signon
  131.   log=log' 'signoff||right(access,4)' 'com
  132.   log=log||right(calls,4)right(uploads,4)
  133.   log=log||right(posts,4)bc'º'
  134.   if V13=1&flag=1 then do
  135.     log=' 'bc'ºc'co||right(port,2)' ----Occupied---For---Private---'
  136.     log=log'Use---- 'signon' 'signoff' -Port-UnAvailab'
  137.     log=log'le- 'bc'º'
  138.   end
  139.   c=index(V12,co)
  140.   if c=length(V12) then c=1
  141.     else c=c+1
  142.   co=substr(V12,c,1)
  143. end
  144.  
  145. call open(f1,d1'Call_Log','w')
  146.   do i=1 to 6
  147.     call writeln(f1,top.i)
  148.   end i
  149.  
  150.   if V11=1 then do ; start=1
  151.     if logged=total then start=2
  152.     do i=start to logged
  153.       call writeln(f1,lc.i)
  154.     end i
  155.     call writeln(f1,log)
  156.   end
  157.  
  158.   if V11=0 then do ; end=logged
  159.     if logged=total then end=logged-1
  160.     call writeln(f1,log)
  161.     do i=1 to end
  162.       call writeln(f1,lc.i)
  163.     end i
  164.   end
  165.  
  166.   do i=1 to 4
  167.     call writeln(f1,bot.i)
  168.   end i
  169. call close(f1)
  170. logged=logged+1 ; if logged>total then logged=total
  171. call SAVECONFIG
  172.  
  173. tr 'h6ed!'
  174. QUIT:;call setclip('logger');exit
  175.  
  176. COMPUTERS:
  177.   if exists(d2'Call_Log_Computers3') then do
  178.     call open(f1,d2'Call_Log_Computers3','r')
  179.       do i=0 to ct-1
  180.         comp.i=readln(f1)
  181.       end i
  182.     call close(f1)
  183.     return
  184.   end
  185.   call open(f1,'cnet:bbsmenu','r') ; ct=0
  186.     do until left(j,2)='30'
  187.       j=readln(f1)
  188.     end
  189.     do until r=''
  190.       r=readln(f1) ; r=strip(substr(r,2))
  191.       comp.ct=left(r,3) ; ct=ct+1
  192.     end
  193.   call close(f1)
  194.   ct=ct-1 ; call SAVECONFIG
  195.   call open(f1,d2'Call_Log_Computers3','w')
  196.     do i=0 to ct-1
  197.       call writeln(f1,comp.i)
  198.     end i
  199.   call close(f1)
  200. return
  201.  
  202. READLOG:
  203.   if exists(d1'Call_Log') then do
  204.     call open(f1,d1'Call_Log','r')
  205.       do i=1 to 6
  206.         j=readln(f1)
  207.       end i
  208.       do i=1 to logged
  209.         lc.i=readln(f1)
  210.       end i
  211.     call close(f1)
  212.     return
  213.   end
  214.   call open(f1,d1'Call_Log','w')
  215.     do i=1 to 6
  216.       call writeln(f1,top.i)
  217.     end i
  218.     call writeln(f1,mid.1)
  219.     logged=1
  220.     do i=1 to 4
  221.       call writeln(f1,bot.i)
  222.     end i
  223.   call close(f1)
  224.   call SAVECONFIG
  225. signal READLOG
  226.  
  227. READCONFIG:
  228.   if ~exists(d2'Call_Log_Config') then do
  229.     l=substr(V12,2,1)
  230.     call open(f1,d2'Call_Log_Config','w')
  231.       call writeln(f1,'0  <--- Total Calls Logged')
  232.       call writeln(f1,'0  <--- Total Computer Types')
  233.       call writeln(f1,'0  <--- Total SysOp Calls')
  234.       call writeln(f1,l'  <--- Next Quick Log Color')
  235.     call close(f1)
  236.     signal READCONFIG
  237.   end
  238.   call open(f1,d2'Call_Log_Config','r')
  239.     a=readln(f1) ; logged=word(a,1)     ; a=readln(f1) ; ct=word(a,1)
  240.     a=readln(f1) ; sysopcalls=word(a,1) ; a=readln(f1) ; co=word(a,1)
  241.   call close(f1)
  242.   if id=1 then do
  243.     sysopcalls=sysopcalls+1 ; call SAVECONFIG
  244.   end
  245. return
  246.  
  247. SAVECONFIG:
  248.   a1=left(logged,3)'<-- Total Calls Logged'
  249.   a2=left(ct,3)'<-- Total Computer Types'
  250.   a3=left(sysopcalls,3)'<-- Total SysOp Calls'
  251.   a4=left(co,3)'<-- Next Quick Log Color'
  252.   call open(f1,d2'Call_Log_Config','w')
  253.     call writeln(f1,a1)
  254.     call writeln(f1,a2)
  255.     call writeln(f1,a3)
  256.     call writeln(f1,a4)
  257.   call close(f1)
  258. return
  259.  
  260. DATA0:
  261.   act=0 ; ct=0 ; logged=0 ; sysopcalls=0
  262.   if V9=1 then top.1=cs'@4CÜÜÕÍ͸ÜÕÍ͸ÜÕ¸ÜÜÜÕ¸ÜÜÜÕÍ͸ÜÕÍ͸ÜÜÜÜÕ¸ÜÜÜÕÍ͸ÜÕÍ͸ÜÜ'
  263.   if V9=0 then top.1=cs'a1@4CÜÜÕÍ͸ÜÕÍ͸ÜÕ¸ÜÜÜÕ¸ÜÜÜÕÍ͸ÜÕÍ͸ÜÜÜÜÕ¸ÜÜÜÕÍ͸ÜÕÍ͸ÜÜ'
  264.   top.2='Cß     ³    ÆÍ͵ ³    ³    Æ͵  ÆÍѾ    ³    ³  ³ ³Õ͸     ß'
  265.   top.3='          Ü ßßßßÔÍ;ßÔßß¾ßÔÍ;ßÔÍ;ßÔÍ;ßÔßÔ¾ßßßßÔÍ;ßÔÍ;ßÔÍ;ßßßß Ü          '
  266.   top.4=' ÉÍÍÑÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÑÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÑÍÍÍÍÍÍÍÑÍÍÑÍÍÍÑÍÍÍÑÍÍÍÑÍÍÍ» '
  267.   top.5=" ºP#³ID#³*User's Handle *=New³Bd³Activities³SignOn³SignOff³AG³Com³CaT³UpL³Posº "
  268.   top.6=' ÌÍÍÏÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÏÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÏÍÍÍÍÍÍÍÏÍÍÏÍÍÍÏÍÍÍÏÍÍÍÏÍÍ͹ '
  269.   bot.1=' ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ '
  270.   bot.2='  P#=Port Bd=Baud AG=AccessGroup Com=Computer CaT=Calls UpL=Uploads Pos=Posts  '
  271.   bot.3='   ActivitiesP:ost R:esponse U:pload D:ownload G:ame T:ext F:eedback M:ail   '
  272.   bot.4='     Caller Log, v3.32 Written by: Dotoran of Frontiers BBS(716)/823-9892      '
  273.   gu 12 ; start='Call Log Started On: 'left(result,15)
  274.   mid.1='z4 z0cfº                    cb'start'                   cfºz4 z0'
  275. return
  276.  
  277. DATA1:
  278.   act=0 ; ct=0 ; logged=0 ; sysopcalls=0
  279.   if V9=1 then top.1=cs'@4CÚÄ¿ÚÄ¿Ú  Ú  ÚÄ¿Ú¿     Ú  ÚÄ¿ÚÄ¿'
  280.   if V9=0 then top.1=cs'a1@4CÚÄ¿ÚÄ¿Ú  Ú  ÚÄ¿Ú¿     Ú  ÚÄ¿ÚÄ¿'
  281.   top.2=' 'bc'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»³  ÃÄ´³  ³  Ã¿ ÃÁ¿    ³  ³ ³³Ú¿'bc'ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»'
  282.   top.3=' ºCall Frontiers BBS!'bc'ºÀÄÙÀ ÙÀÄÙÀÄÙÀÄÙÀ À3.32ÀÄÙÀÄÙÀÄÙ'bc'º(716)/823-9892 (28800)!'bc'º'
  283.   top.4=' ÌÍÍÑÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÊÍÍÍÍÍÍÍÑÍÍÑÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÑÍÍÊÍÍÍÍÑÍÍÑÍÍÍÑÍÍÍÑÍÍÍÑÍÍ͹'
  284.   top.5=" ºP#"bc"³ID#"bc"³*User's Handle *=New"bc"³Bd"bc"³Activities"bc"³SignOn"bc"³SignOff"bc"³AG"bc"³Com"bc"³CaT"bc"³UpL"bc"³Pos"bc"º"
  285.   top.6=' ÌÍÍÏÍÍÍÏÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÏÍÍÏÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÏÍÍÍÍÍÍÍÏÍÍÏÍÍÍÏÍÍÍÏÍÍÍÏÍÍ͹'
  286.   bot.1=' ÌÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍÍÍÍÑÍÍÍÍÍÍÍÍ͹'
  287.   bot.2=' ºP#=Port'bc'³Bd=Baud'bc'³AG=AccessGroup'bc'³Com=Computer'bc'³CaT=Calls'bc'³UpL=Uploads'bc'³Pos=Posts'bc'º'
  288.   bot.3=' È»Activities:'bc'³P:ost'bc'³R:esponse'bc'³U:pload'bc'³D:ownload'bc'³G:ame'bc'³T:ext'bc'³F:eedback'bc'³M:ail'bc'ɼ'
  289.   bot.4='  ÈÍÍÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÏÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍͼ'
  290.   gu 12 ; start='Call Log Started On: 'left(result,15) ; l=left(V12,1)
  291.   mid.1=' 'bc'º                    c'l||start'                   'bc'º'
  292. return
  293.  
  294. SYNTAX:;ERROR:;IOERR:;e1=' Error: 'rc' ('errortext(rc)')'
  295.   e2='  Line: 'left(sigl,4)'File:';gu 1311992;a=result;gu 1311960;b=result;c='"'a||b'"';e2=e2' 'c;tr e1;tr e2;logentry e1;logentry e2
  296.   e=sourceline(sigl);do while e~='';e3='Source: 'left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush;exit
  297. /** Last Edited: 8-May-96 *************************************************\
  298. \****************************************** FRONTIERS BBS (716)/823-9892 **/
  299.